
#include    "help/logger.hpp"

#include    "ants/switcher.hpp"

using namespace help;
using namespace ants;

int     main(int argc, char* argv[])
{

    // following info come from configuration
    const char* pszDumpDir = "/tmp/ants";
    int iLogLevelThreshold = LogLevel::DEBUG;
    int iPort = 4344;
    
    Logger& logger = Logger::getInstance();
    logger.setLogLevelThreshold( iLogLevelThreshold );
    
    char    szLogPrefix[256];
    sprintf(szLogPrefix, "%s/ants.%d", pszDumpDir, iPort);
    logger.useFileAppender(szLogPrefix);
    
    Switcher    switcher;

    switcher.setLogger(&logger);
    
    switcher.watchUDP(iPort);
        
    switcher.run();
    
    logger.info("done.");
    logger.error("done.");
    
    return  0;
}

